<?php
/**
 * @author fyl
 * Date: 16-3-29 下午2:59
 */

class AdminService extends BaseService
{
    private static $self           =   NULL;
    private $mAdmin                 =   NULL;
    private $mAds                   =   NULL;
    private $mLog                   =   NULL;
    private $mProject               =   NULL;
    private $mInvestRecord          =   NULL;
    private $mTicketRecord          =   NULL;
    private $mRechargeRecord        =   NULL;
    private $mWithdrawRecord        =   NULL;
    private $mBankManage            =   NULL;
    private $mUser                  =   NULL;
    private $mNews                  =   NULL;
    private $mAbutPartner           =   NULL;
    private $mAbutTeam              =   NULL;
    private $mAbutRecruit           =   NULL;
    private $mCompany               =   NULL;
    private $mFactoringCompany      =   NULL;



    static public function instance()
    {
        if (self::$self == NULL) {
            self::$self = new self;
        }
        return self::$self;
    }


    public function __construct()
    {
        $this->mAdmin                  =   new Involved_AdminModel();
        $this->mAds                    =   new Involved_AdsModel();
        $this->mLog                    =   new Involved_LogModel();
        $this->mProject                =   new Involved_ProjectModel();
        $this->mInvestRecord           =   new Involved_InvestRecordModel();
        $this->mTicketRecord           =   new Involved_TicketRecordModel();
        $this->mRechargeRecord         =   new Involved_RechargeRecordModel();
        $this->mWithdrawRecord         =   new Involved_WithdrawRecordModel();
        $this->mBankManage             =   new Involved_BankManageModel();
        $this->mUser                   =   new Involved_UserModel();
        $this->mNews                   =   new Involved_NewsModel();
        $this->mAbutPartner            =   new Involved_AbutPartnerModel();
        $this->mAbutTeam               =   new Involved_AbutTeamModel();
        $this->mAbutRecruit            =   new Involved_AbutRecruitModel();
        $this->mCompany                =   new Involved_CompanyModel();
        $this->mFactoringCompany       =   new Involved_FactoringCompanyModel();
    }


    /**
     * 验证用户
     */
    public function LoginValidator($user)
    {
        #此处只做简单验证
        if(empty($user->username) || empty($user->password)){
            throw new Exception('必填项不能为空', ProfessionErrorCodeEnum::STATUS_ERROR_PARAMS_MUST);
        }
        if(strtolower($user->captcha) != strtolower(Session::get('mt_Captcha'))){
            throw new Exception('验证码错误', ProfessionErrorCodeEnum::ERROR_VERIFICATION_CODE_WRONG);
        }

        #数据验证
        $admin_info = $this->mAdmin->getLoginAdminInfo($user->username,md5($user->password));
        if(!$admin_info){
            throw new Exception('密码错误', ProfessionErrorCodeEnum::ERROR_PASSWORD_WRONG);
        }
        #存储SESSION
        Session::put(UserEnum::ADMIN_USER_KEY_ID, $admin_info->id);
        Session::put(UserEnum::ADMIN_USER_KEY, $admin_info);
        return $admin_info;
    }


    /**
     * 广告位列表
     */
    public function AdsList()
    {
        return $this->mAds->AdsList();
    }

    /**
     * 广告位添加
     * @param $paramObj
     * @return int
     */
    public function AdsAdd($paramObj)
    {
        if(!empty($paramObj->img))
            $paramObj->img =  QiniuUpload::instance()->upload_files($paramObj->img);
        #添加
        $aData = [
            'ads_name'          =>     $paramObj->ads_name,
            'img'               =>     $paramObj->img,
            'type'              =>     $paramObj->type,
            'is_rec'            =>     $paramObj->is_rec,
            'order_by'          =>     $paramObj->order_by,
            'link'              =>     $paramObj->link,
        ];
        //dd($aData);
        return $this->mAds->insert($aData);
    }
    public function AdsUp($paramObj)
    {
        #图片上传
        $paramObj->img = !empty($paramObj->img) ?
            $paramObj->img =  QiniuUpload::instance()->upload_files($paramObj->img):$paramObj->img_old;
        #修改
        $aData = [
            'ads_name'          =>     $paramObj->ads_name,
            'img'               =>     $paramObj->img,
            'type'              =>     $paramObj->type,
            'is_rec'            =>     $paramObj->is_rec,
            'order_by'          =>     $paramObj->order_by,
            'link'              =>     $paramObj->link,
        ];

        return $this->mAds->update($aData,['ads_id'=>$paramObj->ads_id]);

    }
    public function GetAdsInfo($ads_id)
    {
        return $this->mAds->GetAdsInfo($ads_id);
    }
    public function DelAds($paramObj)
    {
        return $this->mAds->delete(['ads_id'=>$paramObj->ads_id]);
    }
    public function AdsAjax()
    {
        return $this->mAds->AdsList();
    }

    /**
     * 用户列表
     * @return mixed
     */
    public function ManageUser()
    {
        return $this->mUser->ManageUserList();

    }



    /**
     * 用户添加
     * @param $paramObj
     * @return int
     * @throws Exception
     */
    public function UserAdd($paramObj)
    {
        if(empty($paramObj->password))
            return Redirect::to('/add_user');
        if($paramObj->password!==$paramObj->sure)
            return Redirect::to('/add_user');
        if(!empty($paramObj->avatar))
            $paramObj->avatar =  QiniuUpload::instance()->upload_files($paramObj->avatar);
        $aData = [
            'user_name'           =>    $paramObj->user_name,
            'real_name'           =>    $paramObj->real_name,
            'mobile'              =>    $paramObj->mobile,
            'id_card'             =>    $paramObj->id_card,
            'password'            =>    md5($paramObj->password),
            'avatar'              =>    $paramObj->avatar,
            'status'              =>    $paramObj->status,
            'email'               =>    $paramObj->email,
            'sex'                 =>    $paramObj->sex,
            'created'             =>    time(),
            'user_type'           =>    $paramObj->user_type,
        ];
        return $this->mUser->insert($aData);
    }

    /**
     * 用户编辑
     * @return mixed
     */
    public function GetUserInfo($id)
    {
        return $this->mUser->GetUserInfo($id);
    }
    public function UserUp($paramObj)
    {
        if($paramObj->password!==$paramObj->sure)
            return Redirect::to('/edit_admin');
        #图片上传
        $paramObj->avatar = !empty($paramObj->avatar) ?
            $paramObj->avatar =  QiniuUpload::instance()->upload_files($paramObj->avatar):$paramObj->avatar_old;

        #修改分类
        $aData = [
            'user_name'           =>    $paramObj->user_name,
            'real_name'           =>    $paramObj->real_name,
            'mobile'              =>    $paramObj->mobile,
            'id_card'             =>    $paramObj->id_card,
            'password'            =>    md5($paramObj->password),
            'avatar'              =>    $paramObj->avatar,
            'status'              =>    $paramObj->status,
            'email'               =>    $paramObj->email,
            'sex'                 =>    $paramObj->sex,
            'created'             =>    time(),
            'user_type'           =>    $paramObj->user_type,
        ];

        return $this->mUser->update($aData,['user_id'=>$paramObj->user_id]);
    }

    /**
     * 用户删除
     * @return mixed
     */
    public function DeleteUser($aData)
    {
        return $this->mAdmin->delete(['id'=>$aData->id]);
    }


    /**
     * 项目列表
     */
    public function ManageProjectList(){
        return $this->mProject->ManageProjectList();
    }

    /**
     * 项目添加
     */
    public function AddManageProject($paramObj){

            #图片上传

        $paramObj->image1 = !empty($paramObj->image1) ?
           $paramObj->image1    =    QiniuUpload::instance()->upload_files($paramObj->image1):'';
        $paramObj->image2 = !empty($paramObj->image2) ?
           $paramObj->image2    =    QiniuUpload::instance()->upload_files($paramObj->image2):'';
        $paramObj->img1 = !empty($paramObj->img1) ?
           $paramObj->img1      =    QiniuUpload::instance()->upload_files($paramObj->img1):'';
        $paramObj->img2 = !empty($paramObj->img2) ?
           $paramObj->img2      =    QiniuUpload::instance()->upload_files($paramObj->img2):'';
        $paramObj->img3 = !empty($paramObj->img3) ?
           $paramObj->img3      =    QiniuUpload::instance()->upload_files($paramObj->img3):'';

            $company_info = $this->mCompany->CompanyInfo($paramObj->company_name);
            $aData = [
                'project_name'               =>     $paramObj->project_name,
                'company_name'               =>     $paramObj->company_name,
                'factoring_company'          =>     $paramObj->factoring_company,
                'project_scale'              =>     $paramObj->project_scale,
                'yield_rate'                 =>     $paramObj->yield_rate,
                'limit'                      =>     $paramObj->limit,
                'pay_id'                     =>     $paramObj->pay_id,
                'ticket_type'                =>     $paramObj->ticket_type,
                'plate'                      =>     $company_info->plate,
                'rank'                       =>     $company_info->rank,
                'type'                       =>     $paramObj->type,
                'status'                     =>     $paramObj->status,
                'content'                    =>     $paramObj->content,
                'partner_id'                 =>     $paramObj->partner,
                'start_time'                 =>     strtotime($paramObj->start_time),
                'end_time'                   =>     strtotime($paramObj->end_time),
                'purpose'                    =>     $paramObj->purpose,
                'agent_bank'                 =>     104,
                'image1'                     =>     $paramObj->image1,
                'image2'                     =>     $paramObj->image2,
                'img1'                       =>     $paramObj->img1,
                'img2'                       =>     $paramObj->img2,
                'img3'                       =>     $paramObj->img3,
                'created'                    =>     time()
            ];
            //dd($aData);
            return $this->mProject->insert($aData);
    }

    /**
     * 项目修改
     */
    public function UPManageProject($paramObj){

        #图片上传
        $paramObj->image1 = !empty($paramObj->image1) ?
            $paramObj->image1 =  QiniuUpload::instance()->upload_files($paramObj->image1):$paramObj->image1_old;
        $paramObj->image2 = !empty($paramObj->image2) ?
            $paramObj->image2 =  QiniuUpload::instance()->upload_files($paramObj->image2):$paramObj->image2_old;
        $paramObj->img1 = !empty($paramObj->img1) ?
            $paramObj->img1 =  QiniuUpload::instance()->upload_files($paramObj->img1):$paramObj->img1_old;
        $paramObj->img2 = !empty($paramObj->img2) ?
            $paramObj->img2 =  QiniuUpload::instance()->upload_files($paramObj->img2):$paramObj->img2_old;
        $paramObj->img3 = !empty($paramObj->img3) ?
            $paramObj->img3 =  QiniuUpload::instance()->upload_files($paramObj->img3):$paramObj->img3_old;
        #添加
        $company_info = $this->mCompany->CompanyInfo($paramObj->company_name);

        $aData = [
            'project_name'               =>     $paramObj->project_name,
            'company_name'               =>     $paramObj->company_name,
            'factoring_company'          =>     $paramObj->factoring_company,
            'project_scale'              =>     $paramObj->project_scale,
            'yield_rate'                 =>     $paramObj->yield_rate,
            'limit'                      =>     $paramObj->limit,
            'pay_id'                     =>     $paramObj->pay_id,
            'ticket_type'                =>     $paramObj->ticket_type,
            'plate'                      =>     $company_info->plate,
            'rank'                       =>     $company_info->rank,
            'type'                       =>     $paramObj->type,
            'status'                     =>     $paramObj->status,
            'content'                    =>     $paramObj->content,
            'partner_id'                 =>     $paramObj->partner,
            'start_time'                 =>     strtotime($paramObj->start_time),
            'end_time'                   =>     strtotime($paramObj->end_time),
            'purpose'                    =>     $paramObj->purpose,
            'image1'                     =>     $paramObj->image1,
            'image2'                     =>     $paramObj->image2,
            'img1'                       =>     $paramObj->img1,
            'img2'                       =>     $paramObj->img2,
            'img3'                       =>     $paramObj->img3,
            'created'                    =>     time()

        ];
        return $this->mProject->update($aData,['project_id'=>$paramObj->project_id]);
    }


    /**
     * 查询一条项目
     */
    public function SelectOneProject($paramObj){
        $aData =  $paramObj->project_id;
        return $this->mProject->GetProjectOne($aData);
    }

    /**
     * 公司名称查询
     * @return mixed
     */
    public function SelComName()
    {
        return $this->mCompany->SelComName();
    }

    /**
     * 保理公司名称查询
     * @return mixed
     */
    public function FactCompany()
    {
        return $this->mFactoringCompany->FactCompany();
    }

    /**
     * 合作伙伴名称查询
     * @return mixed
     */
    public function Partner()
    {
        return $this->mAbutPartner->Partner();
    }


    /**
     * 项目删除
     * @return mixed
     */
    public function DeleteProject($aData)
    {
        return $this->mProject->delete(['project_id'=>$aData]);
    }

    /**
     * 公司列表查询
     * @return mixed
     */
    public function CompanyList()
    {
        return $this->mCompany->CompanyList();
    }

    /**
     * 公司添加
     * @param $paramObj
     * @return int
     */
    public function CompanyAdd($paramObj)
    {
        $paramObj->logo = !empty($paramObj->logo) ?
            $paramObj->logo =  QiniuUpload::instance()->upload_files($paramObj->logo):'';

        $aData = [
            'company_name'        => $paramObj->company_name,
            'company_person'      => $paramObj->company_person,
            'mobile'              => $paramObj->mobile,
            'brief'               => $paramObj->brief,
            'company_scale'       => $paramObj->company_scale,
            'stock_num'           => $paramObj->stock_num,
            'status'              => $paramObj->status,
            'plate'               => $paramObj->plate,
            'rank'                => $paramObj->rank,
            'logo'                => $paramObj->logo,
            'created'             => time()
        ];

        return $this->mCompany->insert($aData);

    }

    /**
     * 公司修改
     * @param $paramObj
     * @return bool
     */
    public function CompanyUp($paramObj)
    {

        #图片上传
        $paramObj->logo = !empty($paramObj->logo) ?
            $paramObj->logo =  QiniuUpload::instance()->upload_files($paramObj->logo):$paramObj->logo_old;

        $aData = [
            'company_name'        => $paramObj->company_name,
            'company_person'      => $paramObj->company_person,
            'mobile'              => $paramObj->mobile,
            'brief'               => $paramObj->brief,
            'company_scale'       => $paramObj->company_scale,
            'stock_num'           => $paramObj->stock_num,
            'status'              => $paramObj->status,
            'plate'               => $paramObj->plate,
            'rank'                => $paramObj->rank,
            'logo'                => $paramObj->logo,
            'created'             => time()
        ];

        return $this->mCompany->update($aData,['company_id'=>$paramObj->company_id]);
    }

    /**
     * 公司编辑
     * @param $company_id
     * @return mixed
     */
    public function GetCompanyId($company_id)
    {
        return $this->mCompany->GetCompanyId($company_id);
    }


    /**
     * 保理公司列表查询
     * @return mixed
     */
    public function FCompanyList()
    {
        return $this->mFactoringCompany->FCompanyList();
    }

    /**
     * 保理公司添加
     * @param $paramObj
     * @return int
     */
    public function FCompanyAdd($paramObj)
    {
        $aData = [
            'f_company_name'        => $paramObj->f_company_name,
            'f_company_person'      => $paramObj->f_company_person,
            'f_company_phone'       => $paramObj->f_company_phone,
            'company_brief'         => $paramObj->company_brief,
            'assess_opinion'        => $paramObj->assess_opinion,
            'status'                => $paramObj->status,
            'created'               => time()
        ];

        return $this->mFactoringCompany->insert($aData);

    }

    /**
     * 保理公司修改
     * @param $paramObj
     * @return bool
     */
    public function FCompanyUp($paramObj)
    {
        $aData = [
            'f_company_name'        => $paramObj->f_company_name,
            'f_company_person'      => $paramObj->f_company_person,
            'f_company_phone'       => $paramObj->f_company_phone,
            'company_brief'         => $paramObj->company_brief,
            'assess_opinion'        => $paramObj->assess_opinion,
            'status'                => $paramObj->status,
            'created'               => time()
        ];

        return $this->mFactoringCompany->update($aData,['id'=>$paramObj->id]);
    }

    /**
     * 保理公司编辑展示
     * @param $id
     * @return mixed
     */
    public function GetFCompanyId($id)
    {
        return $this->mFactoringCompany->GetFCompanyId($id);
    }


    /**
     * 投标记录列表
     */
    public function InvestRecordList(){
        return $this->mInvestRecord->InvestRecordList();
    }

    /**
     * 查询一条投资记录
     */
    public function SelectOneInvestRecord($paramObj){
        $aData =  $paramObj->invest_id;
        return $this->mInvestRecord->GetInvestRecordOne($aData);
    }

    /**
     * 项目删除
     * @return mixed
     */
    public function DeleteInvestRecord($aData)
    {
        return $this->mInvestRecord->delete(['invest_id'=>$aData]);
    }


    /**
     * 报票记录列表
     */
    public function TicketRecordList(){
        return $this->mTicketRecord->TicketRecordList();
    }

    /**
     * 报票记录删除
     * @return mixed
     */
    public function DeleteTicketRecord($aData)
    {
        return $this->mTicketRecord->delete(['ticket_id'=>$aData]);
    }


    /**
     * 充值记录列表
     */
    public function RechargeRecordList(){
        return $this->mRechargeRecord->RechargeRecordList();
    }

    /**
     * 充值记录删除
     * @return mixed
     */
    public function DeleteRechartRecord($aData)
    {
        return $this->mRechargeRecord->delete(['rechar_id'=>$aData]);
    }

    /**
     * 提现记录列表
     */
    public function WithdrawRecordList(){
        return $this->mWithdrawRecord->WithdrawRecordList();
    }

    /**
     * 提现记录删除
     * @return mixed
     */
    public function DeleteWithdrawRecord($aData)
    {
        return $this->mWithdrawRecord->delete(['withdraw_id'=>$aData]);
    }

    /**
     * 银行卡列表
     */
    public function BankManageList(){
        return $this->mBankManage->BankManageList();
    }

    /**
     * 银行卡删除
     * @return mixed
     */
    public function DeleteBankManage($aData)
    {
        return $this->mBankManage->delete(['bank_id'=>$aData]);
    }


    /**
     * 管理员列表
     * @return mixed
     * @author lzhp
     * @date  2016-04-04
     */
    public function ManageAdmin()
    {
        return $this->mAdmin->ManageAdmin();

    }



    /**
     * 管理员添加
     * @param $paramObj
     * @return int
     * @throws Exception
     */
    public function AdminAdd($paramObj)
    {
        if(empty($paramObj->password))
            return Redirect::to('/add_admin');
        if($paramObj->password!==$paramObj->sure)
            return Redirect::to('/add_admin');
        if(!empty($paramObj->avatar))
            $paramObj->avatar =  QiniuUpload::instance()->upload_files($paramObj->avatar);
        $aData = [
            'name'           => $paramObj->name,
            'real_name'      => $paramObj->real_name,
            'mobile'         => $paramObj->mobile,
            'avatar'         => $paramObj->avatar,
            'password'       => md5($paramObj->password),
            'role_id'        => $paramObj->role_id,
            'status'         => $paramObj->status,
            'created'        => time()
        ];
        return $this->mAdmin->insert($aData);
    }

    /**
     * 管理员编辑
     * @return mixed
     * @author lzhp
     * @date  2016-04-04
     */
    public function GetAdminInfo($id)
    {
        return $this->mAdmin->GetAdminInfo($id);
    }
    public function AdminUp($paramObj)
    {
        if($paramObj->password!==$paramObj->sure)
            return Redirect::to('/edit_admin');
        #图片上传
        $paramObj->avatar = !empty($paramObj->avatar) ?
            $paramObj->avatar =  QiniuUpload::instance()->upload_files($paramObj->avatar):$paramObj->avatar_old;

        #修改分类
        $aData = [
            'name'           => $paramObj->name,
            'real_name'      => $paramObj->real_name,
            'mobile'         => $paramObj->mobile,
            'avatar'         => $paramObj->avatar,
            'password'       => md5($paramObj->password),
            'role_id'        => $paramObj->role_id,
            'status'         => $paramObj->status,
            'created'        => time()
        ];

        return $this->mAdmin->update($aData,['id'=>$paramObj->id]);
    }

    /**
     * 管理员删除
     * @return mixed
     * @author lzhp
     * @date  2016-04-04
     */
    public function DeleteAdmin($aData)
    {
        return $this->mAdmin->delete(['id'=>$aData->id]);
    }


    /**
     * 日志列表
     * @return mixed
     * @author lzhp
     * @date  2016-04-04
     */
    public function LogService()
    {
        return $this->mLog->LogService();
    }
    /**
     * 日志删除
     * @return mixed
     * @author lzhp
     * @date  2016-04-04
     */
    public function DeleteLog($aData)
    {
        return $this->mLog->delete(['log_id'=>$aData->log_id]);
    }
    /**
    --------------------------------------关于我们-------------------------------------
     */

    /**
     * 资讯列表
     * @return mixed
     */
    public function NewsList()
    {
        return $this->mNews->NewsSelect();
    }

    /**
     * 资讯删除
     * @param $aData
     * @return int
     */
    public function NewsDel($aData)
    {
        return $this->mNews->delete(['news_id'=>$aData->news_id]);
    }

    public function GetNewsId($news_id)
    {
        return $this->mNews->GetNewsId($news_id);
    }

    /**
     * 资讯添加
     * @param $paramObj
     * @return int
     */
    public function NewsAdd($paramObj)
    {
        $aData = [
            'title'         => $paramObj->title,
            'content'       => $paramObj->content,
            'source'        => $paramObj->source,
            'type'          => $paramObj->type,
            'author'        => $paramObj->author,
            'created'       => time()
        ];
        return $this->mNews->insert($aData);
    }

    /**
     * 资讯修改
     * @param $paramObj
     * @return bool
     */
    public function NewsUp($paramObj)
    {
        $aData = [
            'title'         => $paramObj->title,
            'content'       => $paramObj->content,
            'source'        => $paramObj->source,
            'type'          => $paramObj->type,
            'author'        => $paramObj->author,
        ];

        return $this->mNews->update($aData,['news_id'=>$paramObj->news_id]);
    }

    /**
     * 合作伙伴列表
     * @return mixed
     */
    public function PartnerList()
    {
        return $this->mAbutPartner->PartnerSelect();
    }

    /**
     * 合作伙伴删除
     */
    public function PartnerDel($aData)
    {
        return $this->mAbutPartner->delete(['partner_id'=>$aData->partner_id]);
    }

    /**
     * 合作伙伴添加
     * @param $paramObj
     * @return int
     */
    public function PartnerAdd($paramObj)
    {
        $aData = [
            'partner_name'      => $paramObj->partner_name,
            'introduce'         => $paramObj->introduce,
            'url'               => $paramObj->url,
            'created'           => time()
        ];

        return $this->mAbutPartner->insert($aData);
    }

    /**
     * 合作伙伴编辑
     * @param $partner_id
     * @return mixed
     */
    public function GetPartnerId($partner_id)
    {
        return $this->mAbutPartner->GetPartnerId($partner_id);
    }

    /**
     * 合作伙伴修改
     * @param $paramObj
     * @return bool
     */
    public function PartnerUp($paramObj)
    {
        $aData = [
            'partner_name'      => $paramObj->partner_name,
            'introduce'         => $paramObj->introduce,
            'url'               => $paramObj->url,

        ];

        return $this->mAbutPartner->update($aData,['partner_id'=>$paramObj->partner_id]);
    }
    /**
     * 团队列表
     * @return mixed
     */
    public function TeamList()
    {
        return $this->mAbutTeam->TeamSelect();
    }

    /**
     * 团队删除
     * @param $aData
     * @return int
     */
    public function TeamDel($aData)
    {
        return $this->mAbutTeam->delete(['team_id'=>$aData->team_id]);
    }

    /**
     * 团队添加
     * @param $paramObj
     * @return int
     */
    public function TeamAdd($paramObj)
    {
        $aData = [
            'team_name'             => $paramObj->team_name,
            'team_position'         => $paramObj->team_position,
            'team_department'       => $paramObj->team_department,
            'introduce'             => $paramObj->introduce,
            'created'               => time()
        ];

        return $this->mAbutTeam->insert($aData);
    }

    /**
     * 团队编辑
     * @param $team_id
     * @return mixed
     */
    public function GetTeamId($team_id)
    {
        return $this->mAbutTeam->GetTeamId($team_id);
    }

    /**
     * 团队修改
     * @param $paramObj
     * @return bool
     */
    public function TeamUp($paramObj)
    {
        $aData = [
            'team_name'             => $paramObj->team_name,
            'team_position'         => $paramObj->team_position,
            'team_department'       => $paramObj->team_department,
            'introduce'             => $paramObj->introduce,

        ];

        return $this->mAbutTeam->update($aData,['team_id'=>$paramObj->team_id]);
    }
    /**
     * 招聘列表
     * @return mixed
     */
    public function RecruitList()
    {
        return $this->mAbutRecruit->RecruitSelect();
    }

    /**
     * 招聘删除
     * @param $aData
     * @return int
     */
    public function RecruitDel($aData)
    {
        return $this->mAbutRecruit->delete(['recruit_id'=>$aData->recruit_id]);
    }

    /**
     * 招聘添加
     * @param $paramObj
     * @return int
     */
    public function RecruitAdd($paramObj)
    {
        $aData = [
            'recruit_position'      => $paramObj->recruit_position,
            'duty'                  => $paramObj->duty,
            'requirement'           => $paramObj->requirement,
            'contact'               => $paramObj->contact,
            'created'               => time()
        ];

        return $this->mAbutRecruit->insert($aData);
    }

    /**
     * 招聘编辑
     */
    public function GetRecruitId($recruit_id)
    {
        return $this->mAbutRecruit->GetRecruitId($recruit_id);
    }
    /**
     * 招聘修改
     * @param $paramObj
     * @return bool
     */
    public function RecruitUp($paramObj)
    {

        $aData = [
            'recruit_position'      => $paramObj->recruit_position,
            'duty'                  => $paramObj->duty,
            'requirement'           => $paramObj->requirement,
            'contact'               => $paramObj->contact,

        ];

        return $this->mAbutRecruit->update($aData,['recruit_id'=>$paramObj->recruit_id]);
    }
    /**
    --------------------------------------关于我们结束-------------------------------------
     */
}